package com.zhangqi.qiojbackendserviceclient.service;


import com.zhangqi.qiojbackendmodel.entity.Question;
import com.zhangqi.qiojbackendmodel.entity.QuestionSubmit;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
* @author 青涩
* @description 针对表【question(题目)】的数据库操作Service
*/
@FeignClient(name = "qioj-backend-question-service",path = "/api/question/inner")
public interface QuestionFeignClient {

    /**
     * 根据题目Id查找题目
     * @param questionId
     * @return
     */

    @GetMapping("/get/id")
    Question getQuestionById(@RequestParam("questionId") long questionId);

    /**
     * 根据题目提交Id查找题目提交信息
     * @param questionSubmitId
     * @return
     */
    @GetMapping("/question_submit/get/id")
    QuestionSubmit getQuestionSubmitById(@RequestParam("questionSubmitId") long questionSubmitId);


    /**
     * 根据题目提交信息 修改题目提交信息
     * @param questionSubmit
     * @return
     */

    @PostMapping("/question_submit/update")
    boolean updateQuestionSubmitById(@RequestBody QuestionSubmit questionSubmit);


    @PostMapping("/question/update")
    boolean updateQuestinById(@RequestBody Question question);

}
